cmake_minimum_required(VERSION 3.10)
project(tinylog)

set(WHEELS /mnt/e/work/wheels/C++)
# 设置C++标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_definitions(-DRAPIDJSON_HAS_STDSTRING=1 -DTIXML_USE_STL -DSHOW_FILE_INFO=1 -DMEYER_S=1 -D__LINUX__ -D__DEBUG__ -DCMD_USE_SINGLETON )

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_BUILD_TYPE Debug)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
   add_compile_options(-g -rdynamic)
   add_link_options( -g -rdynamic -Wl,--allow-shlib-undefined )
else()
   add_compile_options(-O2 -rdynamic)
   add_link_options( -O2 -s -rdynamic -Wl,--allow-shlib-undefined )
endif()

# 头文件目录
include_directories(
    include/
#    /opt/linaro6_64/usr/include
    ${WHEELS}/include/
)

# 链接库目录
link_directories( 
#    /opt/linaro6_64/usr/lib 
)

# 连接库
link_libraries( 
    rt
    m
    dl
    pthread
    stdc++
)

# 添加可执行文件
add_executable(${PROJECT_NAME} 
    main.cpp
    src/log.cpp
    src/pipe.cpp
    src/unixsock.cpp
    ${WHEELS}/src/tinySeqFile.cpp
    ${WHEELS}/src/misc.cpp 
    ${WHEELS}/src/fs.cpp
    ${WHEELS}/src/debug.cpp
)

